import javax.swing.*;
import javax.swing.text.JTextComponent;
import java.awt.*;

public class EnhancedRowHeaderPanel extends JPanel {
    private final LineNumberPanel lineNumberPanel;
    private final CodeFoldingPanel codeFoldingPanel;
    private final JTextComponent textComponent;

    public EnhancedRowHeaderPanel(JTextComponent textComponent) {
        this.textComponent = textComponent;
        this.lineNumberPanel = new LineNumberPanel(textComponent);
        this.codeFoldingPanel = new CodeFoldingPanel(textComponent);

        setLayout(new BorderLayout());
        add(lineNumberPanel, BorderLayout.CENTER);
        add(codeFoldingPanel, BorderLayout.WEST);
        
        setOpaque(false);
    }
    
    public void updateComponents() {
        lineNumberPanel.repaint();
        codeFoldingPanel.repaint();
    }
}